IsDNAsAnchor causes MA creation dialog to loop to "Configure Anchors" page

I'm experimenting with the "IsDNAsAnchor" management agent capability, but if I set it to true the Management Agent creation dialog loops to the "Configure Anchors" page after I click finish, without showing any error or writing anything in the event log.

You can see the problem in this video.

Is there something particular I should do to get "IsDNAsAnchor" to work properly?

I would like to use the FIM object ID as a DN, and I don't care about having a different anchor attribute.

This piece of code allows to reproduce the problem:

using Microsoft.MetadirectoryServices;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace ecma2_test {

    public partial class TestAgent : IMAExtensible2GetParameters,
                                     IMAExtensible2GetCapabilitiesEx,
                                     IMAExtensible2GetSchema,
                                     IMAExtensible2CallExport,
                                     IMAExtensible2CallImport {

        // IMAExtensible2GetParameters
        public IList<ConfigParameterDefinition> GetConfigParameters(KeyedCollection<string, ConfigParameter> configParameters, ConfigParameterPage page) {
            var ret = new List<ConfigParameterDefinition>();
            switch (page) { 
            case ConfigParameterPage.Capabilities:
                ret.Add(ConfigParameterDefinition.CreateCheckBoxParameter("IsDNAsAnchor", false));
                break;
            case ConfigParameterPage.Connectivity:
                // see http://social.technet.microsoft.com/Forums/en-US/34c40677-0208-47bf-9371-1efefeb585e6/weird-ecma2-ma-problem-create-management-agent-dialog-loops-to-capabilities-page
                ret.Add(ConfigParameterDefinition.CreateCheckBoxParameter("Avoid Catastrophic Failures", true));
                break;
            }
            return ret;
        }

        public ParameterValidationResult ValidateConfigParameters(KeyedCollection<string, ConfigParameter> configParameters, ConfigParameterPage page) {
            return new ParameterValidationResult();
        }

        // IMAExtensible2GetCapabilitiesEx
        public MACapabilities GetCapabilitiesEx(KeyedCollection<string, ConfigParameter> configParameters) {
            MACapabilities capabilities = new MACapabilities();
            capabilities.IsDNAsAnchor = (configParameters["IsDNAsAnchor"].Value == "1");
            return capabilities;
        }

        // IMAExtensible2GetSchema
        public Schema GetSchema(KeyedCollection<string, ConfigParameter> configParameters) {
            SchemaType personType = SchemaType.Create("Person", lockAnchorDefinition: true);
            personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute("dn", AttributeType.String));
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("name", AttributeType.String));
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("email", AttributeType.String));
            Schema schema = Schema.Create();
            schema.Types.Add(personType);
            return schema;
        }

        // IMAExtensible2CallExport
        public void CloseExportConnection(CloseExportConnectionRunStep exportRunStep) {
            throw new NotImplementedException();
        }

        public int ExportDefaultPageSize {
            get { return 1000; }
        }

        public int ExportMaxPageSize {
            get { return 5000; }
        }

        public void OpenExportConnection(KeyedCollection<string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep) {
            throw new NotImplementedException();
        }

        public PutExportEntriesResults PutExportEntries(IList<CSEntryChange> csentries) {
            throw new NotImplementedException();
        }

        // IMAExtensible2CallImport
        public CloseImportConnectionResults CloseImportConnection(CloseImportConnectionRunStep importRunStep) {
            throw new NotImplementedException();
        }

        public GetImportEntriesResults GetImportEntries(GetImportEntriesRunStep importRunStep) {
            throw new NotImplementedException();
        }

        public int ImportDefaultPageSize {
            get { return 1000; }
        }

        public int ImportMaxPageSize {
            get { return 5000; }
        }

        public OpenImportConnectionResults OpenImportConnection(KeyedCollection<string, ConfigParameter> configParameters, Schema types, OpenImportConnectionRunStep importRunStep) {
            throw new NotImplementedException();
        }

    }
}
June 25th, 2015 4:03am

The MA creates just fine for me. Since I already had your last code sample compiled, I just copied over the GetConfigParameters and GetCapabilitiesEx. It compiled fine and created fine.

Maybe Microsoft should pay you for debugging their ECMA code?

Mark

Free Windows Admin Tool Kit Click here and download it now
June 26th, 2015 8:26am

Hi Mark,

Are you sure you specified IsDNAsAnchor = true?

June 26th, 2015 9:25am

If I check the box during creation the Configure Anchors page shows DN as the anchor, if I don't check the box the page shows "anchor-attribute" as the anchor. Either way the MA creates just fine.

Is there another major difference between you code on the separate posting with this code. It seems to be that same other than the two functions that I copied over. I'll take a closer look at it.

Mark

Free Windows Admin Tool Kit Click here and download it now
June 26th, 2015 9:42am

I was able to reproduce the problem. Your schema definition is slightly different.

The old code sets "anchor-attribute" as the anchor. This code seems to be ignored if the IsDNAsAnchor is selected and "dn" is set as the anchor automatically. The above code sets an attribute called dn as the anchor in both cases, but they may mean two different things to the system. You about code does work properly if you do not lock the anchor definition.

Mark

June 26th, 2015 9:52am

Hi Mark,

Thank you very much, setting "lockAnchorDefinition" to false works.

Free Windows Admin Tool Kit Click here and download it now
July 1st, 2015 10:20am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics